package com.jmex.audio.openal;

import java.nio.IntBuffer;

import org.lwjgl.BufferUtils;
import org.lwjgl.openal.AL;
import org.lwjgl.openal.AL10;
import org.lwjgl.openal.ALC10;
import org.lwjgl.openal.ALCcontext;
import org.lwjgl.openal.ALCdevice;

public class OpenALUtil
{
	private OpenALUtil() {
		// no c'tor
	}
	
	public static void printOpenALInfo()
	{
		ALCdevice device = AL.getDevice();
		ALCcontext context = AL.getContext();
		System.out.println("Device: "+device);
		System.out.println("Context: "+context);
		
		// Device?
		System.out.println("ALC_DEVICE_SPECIFIER:"+ALC10.alcGetString(device, ALC10.ALC_DEVICE_SPECIFIER));
		System.out.println("ALC_DEFAULT_DEVICE_SPECIFIER:"+ALC10.alcGetString(device, ALC10.ALC_DEFAULT_DEVICE_SPECIFIER));
		
		// Settings
		IntBuffer integerdata = BufferUtils.createIntBuffer(1);
		ALC10.alcGetInteger(device, ALC10.ALC_ATTRIBUTES_SIZE, integerdata);
		integerdata = BufferUtils.createIntBuffer(integerdata.get(0));
		ALC10.alcGetInteger(device, ALC10.ALC_ALL_ATTRIBUTES, integerdata);
		integerdata.rewind();
		while(integerdata.position() != integerdata.capacity())
		{
			System.out.println("I:"+integerdata.get());
		}
		//System.out.println(AL10.alGetString());
	}
}
